package com.bocloud.kong.model;

import com.alibaba.fastjson.JSONObject;
import com.bocloud.model.Interface;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Title: Api Description: Kong API 请求信息实体, 参见
 * https://getkong.org/docs/0.6.x/admin-api/#request-body
 *
 * @author lkx
 * @version 1.0.0
 * @since 2017-02-15 17:51
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Api extends BaseModel {
	private static final long serialVersionUID = 9177479561761205922L;

	private String id = null;

	private String name;

	private Date created_at;

	private String[] hosts;

	private String[] uris;

	private String[] methods;

	private Boolean strip_uri = true;

	private Boolean https_only = false;

	private Boolean http_if_terminated = true;

	private String upstream_url;

	private Boolean preserve_host = false;

	private Integer retries = 5;

	private Integer upstream_connect_timeout = 60000;

	private  Integer upstream_send_timeout = 60000;

	private Integer upstream_read_timeout = 60000;

	private String size;

	private String offset;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}


	public Date getCreated_at() {
		return created_at;
	}

	public void setCreated_at(Date created_at) {
		this.created_at = created_at;
	}

    public String[] getHosts() {
        return hosts;
    }

    public void setHosts(String[] hosts) {
        this.hosts = hosts;
    }

    public String[] getUris() {
        return uris;
    }

    public void setUris(String[] uris) {
        this.uris = uris;
    }

    public String[] getMethods() {
        return methods;
    }

    public void setMethods(String[] methods) {
        this.methods = methods;
    }

    public Boolean getStrip_uri() {
		return strip_uri;
	}

	public void setStrip_uri(Boolean strip_uri) {
		this.strip_uri = strip_uri;
	}

	public Boolean getHttps_only() {
		return https_only;
	}

	public void setHttps_only(Boolean https_only) {
		this.https_only = https_only;
	}

	public Boolean getHttp_if_terminated() {
		return http_if_terminated;
	}

	public void setHttp_if_terminated(Boolean http_if_terminated) {
		this.http_if_terminated = http_if_terminated;
	}

	public String getUpstream_url() {
		return upstream_url;
	}

	public void setUpstream_url(String upstream_url) {
		this.upstream_url = upstream_url;
	}

	public Boolean getPreserve_host() {
		return preserve_host;
	}

	public void setPreserve_host(Boolean preserve_host) {
		this.preserve_host = preserve_host;
	}

	public Integer getRetries() {
		return retries;
	}

	public void setRetries(Integer retries) {
		this.retries = retries;
	}

	public Integer getUpstream_connect_timeout() {
		return upstream_connect_timeout;
	}

	public void setUpstream_connect_timeout(Integer upstream_connect_timeout) {
		this.upstream_connect_timeout = upstream_connect_timeout;
	}

	public Integer getUpstream_send_timeout() {
		return upstream_send_timeout;
	}

	public void setUpstream_send_timeout(Integer upstream_send_timeout) {
		this.upstream_send_timeout = upstream_send_timeout;
	}

	public Integer getUpstream_read_timeout() {
		return upstream_read_timeout;
	}

	public void setUpstream_read_timeout(Integer upstream_read_timeout) {
		this.upstream_read_timeout = upstream_read_timeout;
	}

	public String getSize() {
		return size;
	}

	public void setSize(String size) {
		this.size = size;
	}

	public String getOffset() {
		return offset;
	}

	public void setOffset(String offset) {
		this.offset = offset;
	}

	public Api() {
		super();
	}

	@Override
	public String toString() {
		return JSONObject.toJSONString(this);
	}

}
